using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace XDebugConsole
{
    public static class DebugMouse
    {
        private static bool leftPressed;
        private static Vector2 position;
#if !XBOX360
        private static MouseState prevMouse;
#endif
        public static Vector2 Position
        {
            get { return position; }
        }

        public static bool LeftJustPressed
        {
            get
            {
                if (leftPressed)
                {
                    leftPressed = false;
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }

        public static void Update(GameTime gameTime)
        {
#if !XBOX360
            MouseState mouse = Mouse.GetState();
            if (mouse.LeftButton == ButtonState.Pressed
                && prevMouse.LeftButton == ButtonState.Released)
            {
                leftPressed = true;
            }
            position = new Vector2(mouse.X, mouse.Y);
            prevMouse = mouse;
#endif
        }

        
    }
}
